package main

import (
	"fmt"
	"time"
)

func main() {
	stop := make(chan bool)
	go func() {
		for {
			select {
			case bool := <-stop:
				fmt.Println(bool, "监控退出，停止了。。。")
				return
			default:
				fmt.Println("goroutine 监控中。。。")
			}
		}

	}()

	fmt.Println("通道传值开始。。。。")
	stop <- true

	fmt.Println("通道传值结束。。。。")
	time.Sleep(1 * time.Second)
}
